package com.example.demo.config;

import org.springframework.stereotype.Component;

import java.io.File;

@Component
public class Methods {

    /**
     * 获取当前工作目录 + upload
     * @return
     */
    public String getUploadPath(){
        String root = System.getProperty("user.dir");
        String middleStr = File.separator;
        if (middleStr.equals(root)) {
            middleStr = "";
        }
        return root + middleStr + "upload";
    }

    /**
     * 获取当前工作目录
     * @return
     */
    public String getUserDir(){
        return System.getProperty("user.dir");
    }
}
